import { PetNewBaseView } from "./PetNewBaseView";
import { SWFPlayer } from "../../scene/modle/SWFPlayer";
import { SPetBlood } from "../../../../Message/Game/SPetBlood";
import { LoaderManager } from "../../../../com/gengine/resource/LoaderManager";
import { ImageInfo } from "../../../../com/gengine/resource/info/ImageInfo";
import { GlobalClass } from "../../../../com/mui/core/GlobalClass";
import { PetBloodLineConfig } from "../../resource/PetBloodLineConfig";
import { EffectManager } from "../../manager/EffectManager";
import { DisplayUtil } from "../../../common/DisplayUtil";
import { PetUtil } from "./info/PetUtil";
import { ItemData } from "../../resource/info/ItemData";
import { Cache } from "../../cache/Cache";
import { FilterConst } from "../../../component/gconst/FilterConst";
import { MsgManager } from "../../manager/MsgManager";
import { Language } from "../../../../extend/language/Language";
import { ECategory } from "../../../../Message/Public/ECategory";
import { EProp } from "../../../../Message/Public/EProp";
import { PetBloodVesselVo } from "./vo/PetBloodVesselVo";
import { Dispatcher } from "../../../mvc/core/Dispatcher";
import { DataEvent } from "../../events/DataEvent";
import { EventName } from "../../mvc/EventName";
import { ColorConfig } from "../../resource/ColorConfig";
import { HTMLUtil } from "../../../../com/gengine/utils/HTMLUtil";
import { GlobalStyle } from "../../../common/global/GlobalStyle";
import { ObjCreate } from "../common/ObjCreate";
import { ModelType } from "../../scene/modle/data/ModelType";
import { ResFileConst } from "../../resource/ResFileConst";
import { IDispose } from "../../../../com/gengine/core/IDispose";
import { EquipmentUtil } from "../common/util/EquipmentUtil";
import { DefInfo } from "../../resource/info/DefInfo";
import { GLoadedButton } from "../../../../com/mui/controls/GLoadedButton";
import { ExpAddEffect } from "../effect/ExpAddEffect";
import { ExpAddEffectInfo } from "../../resource/info/ExpAddEffectInfo";
import { SPetInfo } from "../../../../Message/Game/SPetInfo";
import { SMoney } from "../../../../Message/Game/SMoney";
import { ImagesConst } from "../../resource/ImagesConst";
import { GTextFormat } from "../../../common/GTextFormat";
import { FontUtil } from "../../../common/font/FontUtil";
import { GImageBitmap } from "../../../../com/mui/controls/GImageBitmap";
import { BgItem } from "../common/BgItem";
import { LoaderHelp } from "../../../common/display/LoaderHelp";
import { GTextFiled } from "../../../../com/mui/controls/GTextFiled";
import { GBitmap } from "../../../../com/mui/controls/GBitmap";
import { GCheckBox } from "../../../../com/mui/controls/GCheckBox";
import { GButton } from "../../../../com/mui/controls/GButton";
import { Vector } from "../../../../__AS3__/vec/Vector";
type int = number;
//class PetBloodVesselPanel
    
    export  class PetBloodVesselPanel extends PetNewBaseView
    {
        constructor()
        {
            super();
            this._effect = new Vector.<SWFPlayer>();
            this._proData = new SPetBlood();
            this._dataCopy = new SPetBlood();
            return;
        }

        /* internal  */set pointsAndLines(arg1: SPetBlood)
        {
            var $value: SPetBlood;
            var pointArr: Array<any>;

            var loc1;
            $value = arg1;
            if (this._curSelectIndex != $value.curCategory) 
            {
                this._proData.curCategory = this._curSelectIndex;
                this._proData.curQuality = 9;
                this._proData.curType = 8;
            }
            else 
            {
                this._proData = $value;
            }
            LoaderManager.instance.load("PetBloodVessel_" + this._proData.curCategory + ".png", (arg1: ImageInfo): void
            {
                _bg.bitmapData = arg1.bitmapData;
                return;
            })
            if (this._loadCom) 
            {
                this._name.bitmapData = GlobalClass.getBitmapData("PetBloodVesselType_" + this._proData.curCategory);
            }
            pointArr = PetBloodLineConfig.instance.getPonits(this._proData.curCategory);
            this.setPoints(pointArr, this._proData);
            this.setLines(pointArr, this._proData);
            this.titleName = this._proData;
            this.typeBtn = this._proData;
            return;
        }

        public clean(): void
        {
            this._petInfo = null;
            this._data = null;
            this._totalAttr.text = "";
            this._curAttr.text = "";
            this._rateTxt.text = "";
            this._index = 0;
            this._curSelectIndex = 1;
            this._useBindCB.selected = true;
            this._lineSp.graphics.clear();
            this.cleanPointAndEffect();
            EffectManager.glowFilterUnReg(this._lineSp);
            DisplayUtil.removeAllChild(this._pointSp);
            return;
        }

        /* internal  */onUseBindCBChangeHandler(arg1: Object /* flash.events.Event */=null): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=false;
            var loc5=0;
            if (this._useBindCB.selected) 
            {
                loc1 = PetUtil.activeItemCodes;
                if (loc1.length > 0) 
                {
                    if (PetUtil.curUseBloodItemCode > 0) 
                    {
                        loc2 = new ItemData(PetUtil.curUseBloodItemCode);
                        if (loc2.bind != 1) 
                        {
                            loc3 = loc2.itemCode;
                            this._activeItemNum = Cache.instance.pack.backPackCache.getItemCountByCodeArray([loc2.itemCode + 1, loc2.itemCode]);
                        }
                        else 
                        {
                            loc3 = loc2.codeUnbind;
                            this._activeItemNum = Cache.instance.pack.backPackCache.getItemCountByCodeArray([loc2.itemCode, loc2.codeUnbind]);
                        }
                        this._material.setItemCode(loc3, this._activeItemNum);
                        this._material.filters = this._activeItemNum > 0 ? null : [FilterConst.colorFilter2];
                        PetUtil.curUseBloodItemCode = 0;
                    }
                    else 
                    {
                        loc4 = false;
                        loc5 = 0;
                        while (loc5 < loc1.length) 
                        {
                            this._activeItemNum = Cache.instance.pack.backPackCache.getItemCountByCodeArray([loc1[loc5], loc1[loc5 + 1]]);
                            if (this._activeItemNum > 0) 
                            {
                                this._material.setItemCode(loc1[loc5 + 1], this._activeItemNum);
                                loc4 = true;
                                break;
                            }
                            loc5 = loc5 + 2;
                        }
                        if (!loc4) 
                        {
                            this._material.setItemCode(loc1[1], this._activeItemNum);
                        }
                        this._material.filters = this._activeItemNum > 0 ? null : [FilterConst.colorFilter2];
                    }
                    if (this._index == 0 && this._activeItemNum == 0) 
                    {
                        this._useBindCB.selected = false;
                        this._useBindCB.dispatchEvent(new Object /* flash.events.Event */(flash.events.Event.CHANGE));
                    }
                }
                else 
                {
                    this._useBindCB.selected = false;
                    this._useBindCB.dispatchEvent(new Object /* flash.events.Event */(flash.events.Event.CHANGE));
                    if (this._index != 0) 
                    {
                        MsgManager.showRollTipsMsg(Language.getString(28506));
                    }
                }
            }
            else 
            {
                this._noActiveItemNum = Cache.instance.pack.backPackCache.getItemCountByCategoryAndType(ECategory._ECategoryProp, EProp._EPropPetBloodUpgrade);
                this._material.setItemCode(14170000, this._noActiveItemNum);
                this._material.filters = this._noActiveItemNum > 0 ? null : [FilterConst.colorFilter2];
            }
            return;
        }

        /* internal  */onActivateHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            var loc1=null;
            if (this._data && this._petInfo) 
            {
                if (this._curSelectIndex != this._data.curCategory) 
                {
                    MsgManager.showRollTipsMsg(Language.getString(28512));
                    return;
                }
                loc1 = new PetBloodVesselVo();
                loc1.petUid = this._petInfo.uid;
                loc1.category = this._data.curCategory;
                loc1.quality = this._data.curQuality;
                loc1.type = this._data.curType;
                loc1.useActiveProp = this._useBindCB.selected;
                Dispatcher.dispatchEvent(new DataEvent(EventName.PetBloodUpgradeReq, loc1));
                this._activateBtn.enabled = false;
            }
            return;
        }

        /* internal  */onChangePageHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            if (this._data == null || this._loadCom == false) 
            {
                return;
            }
            if (arg1.target.name != "btnLeft") 
            {
                loc2 = ((loc1 = this)._curSelectIndex + 1);
                loc1._curSelectIndex = loc2;
                this.pointsAndLines = this.copyData;
                if (this._curSelectIndex >= this._data.curCategory) 
                {
                    this._btnLeft.visible = true;
                    this._btnRight.visible = false;
                }
                else 
                {
                    this._btnLeft.visible = true;
                    this._btnRight.visible = true;
                }
            }
            else 
            {
                var loc1;
                var loc2=((loc1 = this)._curSelectIndex - 1);
                loc1._curSelectIndex = loc2;
                this.pointsAndLines = this.copyData;
                if (this._curSelectIndex != 1) 
                {
                    this._btnLeft.visible = true;
                    this._btnRight.visible = true;
                }
                else 
                {
                    this._btnLeft.visible = false;
                    this._btnRight.visible = true;
                }
            }
            return;
        }

        /* internal  */get copyData(): SPetBlood
        {
            this._dataCopy.curCategory = this._data.curCategory;
            this._dataCopy.curQuality = this._data.curQuality;
            this._dataCopy.curType = this._data.curType;
            return this._dataCopy;
        }

        /* internal  */set typeBtn(arg1: SPetBlood)
        {
            this._typeBtn.styleName = "PetBloodVesselTypeBtn" + arg1.curCategory;
            this._typeBtn.toolTipData = PetUtil.getAddAttr(arg1.curCategory, arg1.curQuality, arg1.curType);
            return;
        }

        /* internal  */set titleName(arg1: SPetBlood)
        {
            var loc1=PetBloodLineConfig.instance.getName(arg1.curCategory);
            var loc2=PetBloodLineConfig.instance.getTierName(arg1.curQuality);
            var loc3=PetBloodLineConfig.instance.getRealmAndLevel(arg1.curCategory, false);
            var loc4=ColorConfig.instance.getItemColorString(Math.ceil(arg1.curQuality / 3) + 1);
            this._title.htmlText = HTMLUtil.addColor(Language.getStringByParam(28511, loc3.realm + "·" + loc3.lv, loc2), loc4);
            return;
        }

        /* internal  */setLines(arg1: Array<any>, arg2: SPetBlood): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=(arg2.curType - 1);
            this._lineSp.graphics.clear();
            var loc4=0;
            while (loc4 < arg2.curType) 
            {
                if (loc4 + 1 < loc3) 
                {
                    loc1 = arg1[loc4] as Object /* flash.geom.Point */;
                    loc2 = arg1[loc4 + 1] as Object /* flash.geom.Point */;
                    if (loc4 == 0) 
                    {
                        this._lineSp.graphics.moveTo(loc1.x, loc1.y);
                    }
                    this._lineSp.graphics.lineStyle(4, GlobalStyle.color1Uint, 1);
                    this._lineSp.graphics.lineTo(loc2.x, loc2.y);
                }
                ++loc4;
            }
            EffectManager.glowFilterUnReg(this._lineSp);
            EffectManager.glowFilterReg(this._lineSp, [FilterConst.blueFilter]);
            return;
        }

        /* internal  */setPoints(arg1: Array<any>, arg2: SPetBlood): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=null;
            var loc4=0;
            var loc9=null;
            var loc10=0;
            var loc11=null;
            var loc5=this._pointSp.numChildren;
            var loc6=arg1.length;
            var loc7=Math.ceil(arg2.curQuality / 3);
            var loc8=(arg2.curType - 1);
            this.cleanPointAndEffect();
            loc10 = 0;
            while (loc10 < loc6) 
            {
                loc9 = arg1[loc10] as Object /* flash.geom.Point */;
                loc3 = HTMLUtil.removeHtml(PetBloodLineConfig.instance.getItemAttr(arg2.curCategory, arg2.curQuality, loc10 + 1));
                loc4 = PetUtil.getOffset(arg2.curCategory, arg2.curQuality, loc10 + 1);
                if (loc10 < loc8) 
                {
                    loc1 = ObjCreate.createGLoadedButton("PetBloodVesselBtn" + loc7, loc9.x - 18, loc9.y - 17.5, 36, 35, this._pointSp);
                    if (loc10 < this._effect.length) 
                    {
                        loc11 = this._effect[loc10] as SWFPlayer;
                    }
                    else 
                    {
                        (loc11 = new SWFPlayer()).timeRate = 1 / 72;
                    }
                    if (loc10 == 6 && loc8 == 7 || this._petInfo == null) 
                    {
                        DisplayUtil.removeMe(this._curIndexEffect);
                    }
                    loc11.move(loc9.x, loc9.y);
                    this._pointSp.addChild(loc11);
                    loc11.load("PetBloodVesselType_" + loc7 + ".swf", ModelType.Item, null);
                }
                else 
                {
                    loc1 = ObjCreate.createGLoadedButton(ResFileConst.PetBloodVesselBtn0, loc9.x - 18, loc9.y - 17.5, 36, 35, this._pointSp);
                    if (loc10 == loc8 && this._petInfo) 
                    {
                        loc2 = ObjCreate.createGTextField(HTMLUtil.addColor(loc3, GlobalStyle.color5), loc9.x - 40, loc9.y + loc4, 80, 20, this._pointSp, this._textFormat, true);
                        this._curIndexEffect.move(loc9.x + 3, loc9.y + 3);
                        this.addChild(this._curIndexEffect);
                    }
                }
                loc1.name = "btn" + (loc10 + 1);
                loc1.toolTipData = PetUtil.getAllIndexAttr(arg2.curCategory, arg2.curQuality, loc10 + 1, loc8);
                ++loc10;
            }
            return;
        }

        /* internal  */cleanPointAndEffect(): void
        {
            var loc1=this._pointSp.numChildren;
            var loc2=0;
            while (loc2 < loc1) 
            {
                IDispose(this._pointSp.getChildAt(0)).dispose();
                ++loc2;
            }
            return;
        }

        /* internal  */set filterAndEnabled(arg1: Boolean)
        {
            if (arg1) 
            {
                this._bg.filters = null;
                this._lineSp.filters = null;
                this._pointSp.filters = null;
            }
            else 
            {
                this._bg.filters = [FilterConst.colorFilter2];
                this._lineSp.filters = [FilterConst.colorFilter2];
                this._pointSp.filters = [FilterConst.colorFilter2];
                this._title.text = "";
            }
            this._activateBtn.enabled = arg1;
            this._typeBtn.filterEnabled = arg1;
            this._useBindCB.enabled = arg1;
            return;
        }

        /* internal  */refresh(): void
        {
            var loc1=0;
            var loc2=null;
            var loc3=null;
            var loc4=0;
            var loc5=null;
            var loc6=null;
            var loc7=null;
            var loc8=null;
            var loc9=null;
            var loc10=null;
            var loc11=null;
            var loc12=0;
            if (this._data && this._loadCom) 
            {
                loc1 = Cache.instance.role.entityInfo.career;
                loc2 = PetBloodLineConfig.instance.getTotallAttr(this._data.curCategory, this._data.curQuality, (this._data.curType - 1));
                loc3 = EquipmentUtil.getSelfCareerAttribute(loc1, PetUtil.getAttr(loc2));
                loc4 = loc3.length;
                loc6 = "";
                loc7 = PetBloodLineConfig.instance.getName(this._data.curCategory);
                loc8 = PetBloodLineConfig.instance.getItemAttr(this._data.curCategory, this._data.curQuality, this._data.curType);
                loc12 = 0;
                while (loc12 < loc4) 
                {
                    if ((loc5 = loc3[loc12] as DefInfo).name.length != 4) 
                    {
                        loc10 = loc5.name.substr(0, 1);
                        loc11 = loc5.name.substr(1, 1);
                        loc9 = loc10 + "    " + loc11;
                    }
                    else 
                    {
                        loc9 = loc5.name;
                    }
                    loc6 = loc6 + (loc9 + "：" + HTMLUtil.addColor(loc5.value.toString(), GlobalStyle.color2) + "<br>");
                    ++loc12;
                }
                this._btnLeft.visible = this._data.curCategory > 1;
                this._curAttr.htmlText = Language.getStringByParam(28505, loc7, this._data.curType, loc8);
                this._totalAttr.htmlText = loc6;
                this._rateTxt.text = PetBloodLineConfig.instance.getRate(this._data.curCategory, this._data.curQuality, this._data.curType);
                this.pointsAndLines = this.copyData;
                this.typeBtn = this.copyData;
            }
            return;
        }

        public set data(arg1: SPetBlood)
        {
            this._data = arg1;
            this._curSelectIndex = this._data.curCategory;
            this._activateBtn.enabled = true;
            this.refresh();
            return;
        }

        public petBloodUpgradeResult(arg1: Boolean, arg2: SPetBlood): void
        {
            var isSucceed: Boolean;
            var vo: SPetBlood;
            var obj: Object /* flash.display.DisplayObjectContainer */;
            var callLater: Function;
            var curType: int;
            var btn: GLoadedButton;
            var effect: ExpAddEffect;
            var expAddEffectInfo: ExpAddEffectInfo;
            var pointArr: Array<any>;

            var loc1;
            obj = null;
            callLater = null;
            curType = 0;
            btn = null;
            effect = null;
            expAddEffectInfo = null;
            pointArr = null;
            isSucceed = arg1;
            vo = arg2;
            callLater = (): void
            {
                var loc1=1;
                while (loc1 <= 7) 
                {
                    btn = _pointSp.getChildByName("btn" + loc1) as GLoadedButton;
                    expAddEffectInfo = new ExpAddEffectInfo(getX(btn) + 3, getY(btn) + 3, getX(_typeBtn), getY(_typeBtn), 0, 0.3, null, obj, false);
                    effect = new ExpAddEffect(expAddEffectInfo);
                    effect.playEffect();
                    ++loc1;
                }
                return;
            }
            obj = this as Object /* flash.display.DisplayObjectContainer */;
            if (isSucceed) 
            {
                curType = (vo.curType - 1);
                btn = this._pointSp.getChildByName("btn" + curType) as GLoadedButton;
                if (btn) 
                {
                    expAddEffectInfo = new ExpAddEffectInfo(this.getX(this._activateBtn), this.getY(this._activateBtn), this.getX(btn) + 3, this.getY(btn) + 3, 0, 0.5, null, obj, false);
                    effect = new ExpAddEffect(expAddEffectInfo);
                    effect.playEffect();
                }
                if (curType == 7) 
                {
                    flash.utils.setTimeout(callLater, 1000);
                    pointArr = PetBloodLineConfig.instance.getPonits(vo.curCategory);
                    this.setPoints(pointArr, vo);
                    this.setLines(pointArr, vo);
                }
            }
            else 
            {
                this._activateBtn.enabled = true;
            }
            return;
        }

        /* internal  */getX(arg1: Object /* flash.display.DisplayObject */): number
        {
            return arg1.x + arg1.width / 2;
        }

        /* internal  */getY(arg1: Object /* flash.display.DisplayObject */): number
        {
            return arg1.y + arg1.height / 2;
        }

        public /* override */ updateByPetInfo(arg1: SPetInfo): void
        {
            if (this._index == 0) 
            {
                this.onUseBindCBChangeHandler();
            }
            if (this._petInfo && this._petInfo.uid == arg1.uid) 
            {
                return;
            }
            this._btnLeft.visible = false;
            this._btnRight.visible = false;
            if (arg1.reinLevel < 2) 
            {
                this._petInfo = null;
                this._proData.curCategory = 1;
                this._proData.curQuality = 1;
                this._proData.curType = 1;
                this._curSelectIndex = 1;
                DisplayUtil.removeMe(this._curIndexEffect);
                this.pointsAndLines = this._proData;
                this.typeBtn = this._proData;
                this.filterAndEnabled = false;
                if (this._index > 0) 
                {
                    MsgManager.showRollTipsMsg(Language.getString(28502));
                }
                var loc1;
                var loc2=((loc1 = this)._index + 1);
                loc1._index = loc2;
                return;
            }
            this.filterAndEnabled = true;
            this._petInfo = arg1;
            Dispatcher.dispatchEvent(new DataEvent(EventName.PetBloodInfoReq, this._petInfo.uid));
            loc2 = ((loc1 = this)._index + 1);
            loc1._index = loc2;
            return;
        }

        protected /* override */ onMoneyUpdateHandler(arg1: SMoney=null): void
        {
            return;
        }

        public /* override */ update(arg1: Object, ... rest): void
        {
            super.update(arg1, rest);
            this.clean();
            return;
        }

        protected /* override */ onPackChangeHandler(arg1: Object=null): void
        {
            this.onUseBindCBChangeHandler();
            return;
        }

        /* internal  */onLoadResHandler(): void
        {
            this._loadCom = true;
            ObjCreate.createGBitmap(ImagesConst.PetBloodVesselTotalAttriTxt, 425, 5, this);
            ObjCreate.createGBitmap(ImagesConst.PetBloodVesselCurAttriTxt, 425, 208, this);
            this._name.bitmapData = GlobalClass.getBitmapData(ImagesConst.PetBloodVesselType_1);
            this.refresh();
            return;
        }

        protected /* override */ createDisposedChildrenImpl(): void
        {
            super.createDisposedChildrenImpl();
            this._textFormat = GlobalStyle.setTextFormatAlign(GlobalStyle._textFormat6, flash.text.TextFormatAlign.CENTER);
            ObjCreate.createBg(0, 0, 402, 400, this);
            ObjCreate.createBg(404, 0, 179, 400, this);
            ObjCreate.createBg(405, 0, 160, 25, this, ImagesConst.TileBg);
            ObjCreate.createBg(405, 205, 160, 25, this, ImagesConst.TileBg);
            ObjCreate.createBg(415, 205, 160, 2, this, ImagesConst.SplitLine);
            ObjCreate.createBg(415, 263, 160, 2, this, ImagesConst.SplitLine);
            ObjCreate.createBg(415, 370, 160, 2, this, ImagesConst.SplitLine);
            this._curIndexEffect = new SWFPlayer();
            this._curIndexEffect.timeRate = 1 / 72;
            this._curIndexEffect.load("PetBloodVesselCurIndex.swf", ModelType.Item, null);
            this._bg = ObjCreate.createGBitmap("", 3, 3, this);
            this._title = ObjCreate.createGTextField("", 0, 20, 402, 40, this, new GTextFormat(FontUtil.xingkaiName, 24, 10461087, null, null, null, null, null, flash.text.TextFormatAlign.CENTER));
            this._lineSp = new Object /* flash.display.Sprite */();
            ObjCreate.setObjAttri(this._lineSp, 3, 3, -1, -1, this);
            this._pointSp = new Object /* flash.display.Sprite */();
            ObjCreate.setObjAttri(this._pointSp, 3, 3, -1, -1, this);
            this._name = ObjCreate.createGBitmap("", 22, 15, this);
            this._typeBtn = ObjCreate.createGLoadedButton("", 330, 15, 48, 48, this);
            this._btnLeft = ObjCreate.createGLoadedButton(ResFileConst.MountStartLeft, 0, 170, 40, 43, this);
            this._btnLeft.name = "btnLeft";
            this._btnRight = ObjCreate.createGLoadedButton(ResFileConst.MountStartRight, 364, 170, 40, 43, this);
            this._btnRight.name = "btnRight";
            this._totalAttr = ObjCreate.createGTextField("", 435, 25, 150, 180, this, GlobalStyle.setTextFormatLeading(GlobalStyle._textFormat1, 5));
            this._totalAttr.multiline = true;
            this._totalAttr.wordWrap = true;
            this._curAttr = ObjCreate.createGTextField("", 420, 238, 160, 20, this, GlobalStyle._textFormat5);
            this._rateTxt = ObjCreate.createGTextField("", 513, 272, 80, 20, this, new GTextFormat(FontUtil.songtiName, 16, 6350622, null, null, null, null, null, flash.text.TextFormatAlign.LEFT));
            this.addChild(new GImageBitmap("PetSuccessRate.png", 420, 275));
            this._material = new BgItem();
            ObjCreate.setObjAttri(this._material, 430, 315, -1, -1, this);
            this._useBindCB = ObjCreate.createCheckBox(Language.getString(28504), 438, 375, 140, 20, this);
            this._useBindCB.selected = true;
            this._useBindCB.addEventListener(flash.events.Event.CHANGE, this.onUseBindCBChangeHandler);
            this._activateBtn = ObjCreate.createGButton(Language.getString(28501), 495, 320, 62, 28, this, "ButtonRed");
            this._activateBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onActivateHandler);
            var loc1=ObjCreate.createGBitmap(ImagesConst.RechargeSmallBg, 340, 3, this);
            var loc2=ObjCreate.createGBitmap(ImagesConst.RechargeSmallBg, 340, 398, this);
            loc2.scaleY = -1;
            var loc3=ObjCreate.createGBitmap(ImagesConst.RechargeSmallBg, 62, 3, this);
            loc3.scaleX = -1;
            var loc4;
            (loc4 = ObjCreate.createGBitmap(ImagesConst.RechargeSmallBg, 62, 398, this)).scaleX = -1;
            loc4.scaleY = -1;
            this._btnLeft.addEventListener(flash.events.MouseEvent.CLICK, this.onChangePageHandler);
            this._btnRight.addEventListener(flash.events.MouseEvent.CLICK, this.onChangePageHandler);
            LoaderHelp.addResCallBack(ResFileConst.PetBloodVessel, this.onLoadResHandler);
            return;
        }

        /* internal */ /* var */_activeItemNum: int;

        /* internal */ /* var */_totalAttr: GTextFiled;

        /* internal */ /* var */_bg: GBitmap;

        /* internal */ /* var */_name: GBitmap;

        /* internal */ /* var */_title: GTextFiled;

        /* internal */ /* var */_dataCopy: SPetBlood;

        /* internal */ /* var */_lineSp: Object /* flash.display.Sprite */;

        /* internal */ /* var */_index: int;

        /* internal */ /* var */_pointSp: Object /* flash.display.Sprite */;

        /* internal */ /* var */_curAttr: GTextFiled;

        /* internal */ /* var */_rateTxt: GTextFiled;

        /* internal */ /* var */_material: BgItem;

        /* internal */ /* var */_useBindCB: GCheckBox;

        /* internal */ /* var */_activateBtn: GButton;

        /* internal */ /* var */_btnLeft: GLoadedButton;

        /* internal */ /* var */_btnRight: GLoadedButton;

        /* internal */ /* var */_typeBtn: GLoadedButton;

        /* internal */ /* var */_effect: Vector.<SWFPlayer>;

        /* internal */ /* var */_curIndexEffect: SWFPlayer;

        /* internal */ /* var */_data: SPetBlood;

        /* internal */ /* var */_textFormat: GTextFormat;

        /* internal */ /* var */_loadCom: Boolean;

        /* internal */ /* var */_proData: SPetBlood;

        /* internal */ /* var */_petInfo: SPetInfo;

        /* internal */ /* var */_curSelectIndex: int=1;

        /* internal */ /* var */_noActiveItemNum: int;
    }
